<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<header class="page">
    <div class="status">
        <ul class="nav justify-content-end">
            <c:choose>
                <%--若会话对象中存在customer则认为用于已经登录--%>
                <c:when test="${ not empty sessionScope.customer }">
                    <li class="nav-item">
                        欢迎${customer.nickname}
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/topic/publish">发布话题</a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/topic/mine">我的话题</a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/settings">
                            <i class="fa fa-cog"></i>设置
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/change">修改密码</a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/sign/out">退出</a>
                    </li>
                </c:when>
                <c:otherwise>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/sign/up">注册</a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/sign/in">登录</a>
                    </li>
                </c:otherwise>
            </c:choose>
        </ul>
    </div>
    <div class="row facade">
        <div class="col-3 logo-wrapper">
            <a href="${ctxPath}/index.jsp" class="logo"></a>
        </div>
        <div class="col-9 search-wrapper">
            <form action="${ctxPath}/topic/search" method="post">
                <input type="text" name="keyworkd" placeholder="请输入话题搜索关键字">
                <button type="submit">搜索</button>
            </form>
        </div>
    </div>
</header>